//
//  AiRecognizerDelegate.h
//  AiRecognizerDialog
//
//  Created by hello on 13-7-19.
//  Copyright (c) 2013年 aispeech. All rights reserved.
//

#import <Foundation/Foundation.h>

@protocol AiRecognizerDelegate <NSObject>

@optional
/**
 *	@brief	引擎初始化是否成功
 *
 *	@param 	state      是否成功 (成功:OPT_SUCCESS 失败:OPT_FAILED)
 */
-(void)aiSpeechEngine:(AiSpeechEngine *)engine onInit:(NSNumber *)state ;

/**
 *	@brief	引擎运行完成
 *
 *	@param 	engine      引擎对象
 *	@param 	stopType 	停止类型，参见 AISPEECHENGINE_STOPTYPE
 */
-(void)aiSpeechEngineDidFinishRecording:(AiSpeechEngine *)engine stopType:(int)stopType;


/**
 *	@brief	引擎收到了评测结果
 *
 *	@param 	engine      引擎对象
 *	@param 	recordId 	录音流ID
 *	@param 	jsonString 	服务端返回JSON结果
 */
-(void)aiSpeechEngine:(AiSpeechEngine *)engine didReceive:(NSString *)recordId responseJson:(NSString *)jsonString;

/**
 *	@brief	上报录音数据
 *
 *	@param 	engine      引擎对象
 *	@param 	recordId 	录音ID
 *	@param 	binaryData 	音频数据
 */
-(void)aiSpeechEngine:(AiSpeechEngine *)engine didReceive:(NSString *)recordId responseBinary:(NSData *)binaryData;

/**
 *	@brief	引擎收到录音音量大小
 *
 *	@param 	engine      引擎对象
 *	@param 	recordId 	录音流ID
 *	@param 	volume      服务端返回音量大小
 */
-(void)aiSpeechEngine:(AiSpeechEngine *)engine didReceive:(NSString *)recordId volume:(NSNumber *)volume;


/**
 *	@brief	引擎收到了出错响应
 *
 *	@param 	engine      引擎对象
 *	@param 	recordId 	录音ID
 *	@param 	jsonString 	错误JSON字符串
 */
-(void)aiSpeechEngine:(AiSpeechEngine *)engine didReceive:(NSString *)recordId errorJson:(NSString *)jsonString;


@end
